package com.gph.saviorframework.os.authz.web;

import com.gph.saviorframework.common.model.User;

/**
 * Created by guopeihui on 2017/2/9.
 */
public class SecurityUtils {

    public static User getUser() {
        Object obj = org.apache.shiro.SecurityUtils.getSubject().getPrincipal();
        if (obj instanceof User) {
            return (User) obj;
        }
        else {
            return new User(obj.toString());
        }
    }
}
